/******************************************************************************* 
 *  Copyright 2007 Amazon Technologies, Inc.  
 *  Licensed under the Apache License, Version 2.0 (the "License"); 
 *  
 *  You may not use this file except in compliance with the License. 
 *  You may obtain a copy of the License at: http://aws.amazon.com/apache2.0
 *  This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
 *  CONDITIONS OF ANY KIND, either express or implied. See the License for the 
 *  specific language governing permissions and limitations under the License.
 * ***************************************************************************** 
 *    __  _    _  ___ 
 *   (  )( \/\/ )/ __)
 *   /__\ \    / \__ \
 *  (_)(_) \/\/  (___/
 * 
 *  Amazon ECS CSharp Library
 *  API Version: 2007-07-16
 *  Generated: Thu Aug 02 10:15:38 PDT 2007 
 * 
 */

using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Text;


namespace Amazon.ECS.Model
{
    [XmlTypeAttribute(Namespace = "http://webservices.amazon.com/AWSECommerceService/2007-07-16")]
    [XmlRootAttribute(Namespace = "http://webservices.amazon.com/AWSECommerceService/2007-07-16", IsNullable = false)]
    public class CollectionSummary
    {
    
        private  Price lowestListPriceField;
        private  Price highestListPriceField;
        private  Price lowestSalePriceField;
        private  Price highestSalePriceField;

        /// <summary>
        /// Gets and sets the LowestListPrice property.
        /// </summary>
        [XmlElementAttribute(ElementName = "LowestListPrice")]
        public Price LowestListPrice
        {
            get { return this.lowestListPriceField ; }
            set { this.lowestListPriceField = value; }
        }



        /// <summary>
        /// Sets the LowestListPrice property
        /// </summary>
        /// <param name="lowestListPrice">LowestListPrice property</param>
        /// <returns>this instance</returns>
        public CollectionSummary WithLowestListPrice(Price lowestListPrice)
        {
            this.lowestListPriceField = lowestListPrice;
            return this;
        }



        /// <summary>
        /// Checks if LowestListPrice property is set
        /// </summary>
        /// <returns>true if LowestListPrice property is set</returns>
        public Boolean IsSetLowestListPrice()
        {
            return this.lowestListPriceField != null;
        }




        /// <summary>
        /// Gets and sets the HighestListPrice property.
        /// </summary>
        [XmlElementAttribute(ElementName = "HighestListPrice")]
        public Price HighestListPrice
        {
            get { return this.highestListPriceField ; }
            set { this.highestListPriceField = value; }
        }



        /// <summary>
        /// Sets the HighestListPrice property
        /// </summary>
        /// <param name="highestListPrice">HighestListPrice property</param>
        /// <returns>this instance</returns>
        public CollectionSummary WithHighestListPrice(Price highestListPrice)
        {
            this.highestListPriceField = highestListPrice;
            return this;
        }



        /// <summary>
        /// Checks if HighestListPrice property is set
        /// </summary>
        /// <returns>true if HighestListPrice property is set</returns>
        public Boolean IsSetHighestListPrice()
        {
            return this.highestListPriceField != null;
        }




        /// <summary>
        /// Gets and sets the LowestSalePrice property.
        /// </summary>
        [XmlElementAttribute(ElementName = "LowestSalePrice")]
        public Price LowestSalePrice
        {
            get { return this.lowestSalePriceField ; }
            set { this.lowestSalePriceField = value; }
        }



        /// <summary>
        /// Sets the LowestSalePrice property
        /// </summary>
        /// <param name="lowestSalePrice">LowestSalePrice property</param>
        /// <returns>this instance</returns>
        public CollectionSummary WithLowestSalePrice(Price lowestSalePrice)
        {
            this.lowestSalePriceField = lowestSalePrice;
            return this;
        }



        /// <summary>
        /// Checks if LowestSalePrice property is set
        /// </summary>
        /// <returns>true if LowestSalePrice property is set</returns>
        public Boolean IsSetLowestSalePrice()
        {
            return this.lowestSalePriceField != null;
        }




        /// <summary>
        /// Gets and sets the HighestSalePrice property.
        /// </summary>
        [XmlElementAttribute(ElementName = "HighestSalePrice")]
        public Price HighestSalePrice
        {
            get { return this.highestSalePriceField ; }
            set { this.highestSalePriceField = value; }
        }



        /// <summary>
        /// Sets the HighestSalePrice property
        /// </summary>
        /// <param name="highestSalePrice">HighestSalePrice property</param>
        /// <returns>this instance</returns>
        public CollectionSummary WithHighestSalePrice(Price highestSalePrice)
        {
            this.highestSalePriceField = highestSalePrice;
            return this;
        }



        /// <summary>
        /// Checks if HighestSalePrice property is set
        /// </summary>
        /// <returns>true if HighestSalePrice property is set</returns>
        public Boolean IsSetHighestSalePrice()
        {
            return this.highestSalePriceField != null;
        }






        /// <summary>
        /// XML fragment representation of this object
        /// </summary>
        /// <returns>XML fragment for this object.</returns>
        /// <remarks>
        /// Name for outer tag expected to be set by calling method. 
        /// This fragment returns inner properties representation only
        /// </remarks>


        protected internal String ToXMLFragment() {
            StringBuilder xml = new StringBuilder();
            if (IsSetLowestListPrice()) {
                Price  lowestListPrice = this.LowestListPrice;
                xml.Append("<LowestListPrice>");
                xml.Append(lowestListPrice.ToXMLFragment());
                xml.Append("</LowestListPrice>");
            } 
            if (IsSetHighestListPrice()) {
                Price  highestListPrice = this.HighestListPrice;
                xml.Append("<HighestListPrice>");
                xml.Append(highestListPrice.ToXMLFragment());
                xml.Append("</HighestListPrice>");
            } 
            if (IsSetLowestSalePrice()) {
                Price  lowestSalePrice = this.LowestSalePrice;
                xml.Append("<LowestSalePrice>");
                xml.Append(lowestSalePrice.ToXMLFragment());
                xml.Append("</LowestSalePrice>");
            } 
            if (IsSetHighestSalePrice()) {
                Price  highestSalePrice = this.HighestSalePrice;
                xml.Append("<HighestSalePrice>");
                xml.Append(highestSalePrice.ToXMLFragment());
                xml.Append("</HighestSalePrice>");
            } 
            return xml.ToString();
        }

        /**
         * 
         * Escape XML special characters
         */
        private String EscapeXML(String str) {
            StringBuilder sb = new StringBuilder();
            foreach (Char c in str)
            {
                switch (c) {
                case '&':
                    sb.Append("&amp;");
                    break;
                case '<':
                    sb.Append("&lt;");
                    break;
                case '>':
                    sb.Append("&gt;");
                    break;
                case '\'':
                    sb.Append("&#039;");
                    break;
                case '"':
                    sb.Append("&quot;");
                    break;
                default:
                    sb.Append(c);
                    break;
                }
            }
            return sb.ToString();
        }




    }

}